Skip to content
This repository was archived by the owner on Aug 17, 2025. It is now read-only.

Conversation

@tobias-trozowski
Copy link
Contributor

@tobias-trozowski tobias-trozowski commented Dec 30, 2016

Description

On windows systems process.env.PWD is undefined:

D:\Repositories\test>php-qa-watch -w "phpunit.xml.dist,phpcs.xml,modules/**/*.php"
[2016-12-30T14:21:04.124Z] Watching undefined

Fixed issues

@weierophinney weierophinney added this to the 0.1.2 milestone Jan 4, 2017
var notifier = require('node-notifier');

var pwd = require('process').env.PWD;
var pwd = require('process').env.PWD || require('process').cwd();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cwd() works on any platform, correct? If so, we could just assign to that...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

depends on the use-case. PWD is just the env variable which can be overwritten but cwd() returns the real current working directory. and yes, it works on all platforms.

@weierophinney weierophinney merged commit 441c353 into phly:master Jan 4, 2017
weierophinney added a commit that referenced this pull request Jan 4, 2017
process.env.PWD is undefined on Windows OS
weierophinney added a commit that referenced this pull request Jan 4, 2017
weierophinney added a commit that referenced this pull request Jan 4, 2017
@tobias-trozowski tobias-trozowski deleted the pwd-can-be-undefined branch January 9, 2017 21:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants